<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<html>
  <head>
    <sj:head/>
    <script type="text/javascript">
        $(document).ready( function() {
            $.subscribe('handleResult', function(event,data) {
                $('#div1').append('(Data from event)');
            });
            
        });    
    </script>     
  </head>
  <body>
     <div id="div1">result</div>
        
    <s:url id="ajaxTest" value="/source_jquery_simple.action"/>
    <sj:a id="link1" 
        href="%{ajaxTest}"
        targets="div1"
        loadingText="loading..."
        button="true" 
        buttonIcon="ui-icon-gear">
      Update Content using targets
    </sj:a>
    
        <sj:a id="link2" 
        href="%{ajaxTest}"
        targets="div1"
        onCompleteTopics="handleResult"
        loadingText="loading..."
        button="true" 
        buttonIcon="ui-icon-gear">
      Update Content using event
    </sj:a>
    

    
  </body>  
  
</html>